<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>演示：复制页面内容到剪贴板兼容各浏览器</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.zclip.min.js"></script>
<script type="text/javascript">
$(function(){
	$('#copy_input').zclip({
		path: 'js/ZeroClipboard.swf',
		copy: function(){
			return $('#copy_input').attr("href");
		},
		afterCopy: function(){
			$("<span id='msg'/>").insertAfter($('#copy_input')).text('复制成功').fadeOut(2000);
		}
	});
});
</script>
</head>

<body>
<div id="main">
  <div class="demo">
   		<textarea id="mytext">请输入内容</textarea><br/>

        <a href="www.baidu.com" id="copy_input" class="copy">复制内容</a>
   </div>
</div>
</body>
</html>